﻿using Jay.Sc2.Bof.Lib.State;

namespace Jay.Sc2.Bof.Lib.Action.Terran
{
	public abstract class ActionUpgradeFromArmory : ActionUpgradeFromTerran
	{
		public ActionUpgradeFromArmory(int researchTime, int minerals, int gas) : base(researchTime, minerals, gas) { }
		public override TerranState.TerranProductionBuilding GetProductionBuilding(TerranState state) { return state.Armory; }
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionProduceArmory.Instance } };
				return m_Requirements;
			}
		}
	}
	public class ActionUpgradeVehiclePlating1 : ActionUpgradeFromArmory
	{
		public static ActionUpgradeVehiclePlating1 Instance = new ActionUpgradeVehiclePlating1();
		private ActionUpgradeVehiclePlating1() : base(160, 100, 100) { }
		public override TerranState.TerranUpgrade GetUpgrade(TerranState state) { return state.VehiclePlating1; }
		public override string EventName { get { return "ActionResearchedVehiclePlating1"; } }
	}
	public class ActionUpgradeVehiclePlating2 : ActionUpgradeFromArmory
	{
		public static ActionUpgradeVehiclePlating2 Instance = new ActionUpgradeVehiclePlating2();
		private ActionUpgradeVehiclePlating2() : base(190, 175, 175) { }
		public override TerranState.TerranUpgrade GetUpgrade(TerranState state) { return state.VehiclePlating2; }
		public override string EventName { get { return "ActionResearchedVehiclePlating2"; } }
		public override bool HaveTechnology(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.HaveTechnology(bo) && state.VehiclePlating1.Available;
		}
		public override bool IsInvalid(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.IsInvalid(bo) || !state.VehiclePlating1.Have;
		}
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionUpgradeVehiclePlating1.Instance } };
				return m_Requirements;
			}
		}
	}
	public class ActionUpgradeVehiclePlating3 : ActionUpgradeFromArmory
	{
		public static ActionUpgradeVehiclePlating3 Instance = new ActionUpgradeVehiclePlating3();
		private ActionUpgradeVehiclePlating3() : base(220, 250, 250) { }
		public override TerranState.TerranUpgrade GetUpgrade(TerranState state) { return state.VehiclePlating3; }
		public override string EventName { get { return "ActionResearchedVehiclePlating3"; } }
		public override bool HaveTechnology(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.HaveTechnology(bo) && state.VehiclePlating2.Available;
		}
		public override bool IsInvalid(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.IsInvalid(bo) || !state.VehiclePlating2.Have;
		}
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionUpgradeVehiclePlating2.Instance } };
				return m_Requirements;
			}
		}
	}
	public class ActionUpgradeShipPlating1 : ActionUpgradeFromArmory
	{
		public static ActionUpgradeShipPlating1 Instance = new ActionUpgradeShipPlating1();
		private ActionUpgradeShipPlating1() : base(160, 100, 100) { }
		public override TerranState.TerranUpgrade GetUpgrade(TerranState state) { return state.ShipPlating1; }
		public override string EventName { get { return "ActionResearchedShipPlating1"; } }
	}
	public class ActionUpgradeShipPlating2 : ActionUpgradeFromArmory
	{
		public static ActionUpgradeShipPlating2 Instance = new ActionUpgradeShipPlating2();
		private ActionUpgradeShipPlating2() : base(190, 175, 175) { }
		public override TerranState.TerranUpgrade GetUpgrade(TerranState state) { return state.ShipPlating2; }
		public override string EventName { get { return "ActionResearchedShipPlating2"; } }
		public override bool HaveTechnology(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.HaveTechnology(bo) && state.ShipPlating1.Available;
		}
		public override bool IsInvalid(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.IsInvalid(bo) || !state.ShipPlating1.Have;
		}
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionUpgradeShipPlating1.Instance } };
				return m_Requirements;
			}
		}
	}
	public class ActionUpgradeShipPlating3 : ActionUpgradeFromArmory
	{
		public static ActionUpgradeShipPlating3 Instance = new ActionUpgradeShipPlating3();
		private ActionUpgradeShipPlating3() : base(220, 250, 250) { }
		public override TerranState.TerranUpgrade GetUpgrade(TerranState state) { return state.ShipPlating3; }
		public override string EventName { get { return "ActionResearchedShipPlating3"; } }
		public override bool HaveTechnology(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.HaveTechnology(bo) && state.ShipPlating2.Available;
		}
		public override bool IsInvalid(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.IsInvalid(bo) || !state.ShipPlating2.Have;
		}
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionUpgradeShipPlating2.Instance } };
				return m_Requirements;
			}
		}
	}
	public class ActionUpgradeVehicleWeapons1 : ActionUpgradeFromArmory
	{
		public static ActionUpgradeVehicleWeapons1 Instance = new ActionUpgradeVehicleWeapons1();
		private ActionUpgradeVehicleWeapons1() : base(160, 100, 100) { }
		public override TerranState.TerranUpgrade GetUpgrade(TerranState state) { return state.VehicleWeapons1; }
		public override string EventName { get { return "ActionResearchedVehicleWeapons1"; } }
	}
	public class ActionUpgradeVehicleWeapons2 : ActionUpgradeFromArmory
	{
		public static ActionUpgradeVehicleWeapons2 Instance = new ActionUpgradeVehicleWeapons2();
		private ActionUpgradeVehicleWeapons2() : base(190, 175, 175) { }
		public override TerranState.TerranUpgrade GetUpgrade(TerranState state) { return state.VehicleWeapons2; }
		public override string EventName { get { return "ActionResearchedVehicleWeapons2"; } }
		public override bool HaveTechnology(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.HaveTechnology(bo) && state.VehicleWeapons1.Available;
		}
		public override bool IsInvalid(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.IsInvalid(bo) || !state.VehicleWeapons1.Have;
		}
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionUpgradeVehicleWeapons1.Instance } };
				return m_Requirements;
			}
		}
	}
	public class ActionUpgradeVehicleWeapons3 : ActionUpgradeFromArmory
	{
		public static ActionUpgradeVehicleWeapons3 Instance = new ActionUpgradeVehicleWeapons3();
		private ActionUpgradeVehicleWeapons3() : base(220, 250, 250) { }
		public override TerranState.TerranUpgrade GetUpgrade(TerranState state) { return state.VehicleWeapons3; }
		public override string EventName { get { return "ActionResearchedVehicleWeapons3"; } }
		public override bool HaveTechnology(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.HaveTechnology(bo) && state.VehicleWeapons2.Available;
		}
		public override bool IsInvalid(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.IsInvalid(bo) || !state.VehicleWeapons2.Have;
		}
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionUpgradeVehicleWeapons2.Instance } };
				return m_Requirements;
			}
		}
	}
	public class ActionUpgradeShipWeapons1 : ActionUpgradeFromArmory
	{
		public static ActionUpgradeShipWeapons1 Instance = new ActionUpgradeShipWeapons1();
		private ActionUpgradeShipWeapons1() : base(160, 100, 100) { }
		public override TerranState.TerranUpgrade GetUpgrade(TerranState state) { return state.ShipWeapons1; }
		public override string EventName { get { return "ActionResearchedShipWeapons1"; } }
	}
	public class ActionUpgradeShipWeapons2 : ActionUpgradeFromArmory
	{
		public static ActionUpgradeShipWeapons2 Instance = new ActionUpgradeShipWeapons2();
		private ActionUpgradeShipWeapons2() : base(190, 175, 175) { }
		public override TerranState.TerranUpgrade GetUpgrade(TerranState state) { return state.ShipWeapons2; }
		public override string EventName { get { return "ActionResearchedShipWeapons2"; } }
		public override bool HaveTechnology(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.HaveTechnology(bo) && state.ShipWeapons1.Available;
		}
		public override bool IsInvalid(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.IsInvalid(bo) || !state.ShipWeapons1.Have;
		}
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionUpgradeShipWeapons1.Instance } };
				return m_Requirements;
			}
		}
	}
	public class ActionUpgradeShipWeapons3 : ActionUpgradeFromArmory
	{
		public static ActionUpgradeShipWeapons3 Instance = new ActionUpgradeShipWeapons3();
		private ActionUpgradeShipWeapons3() : base(220, 250, 250) { }
		public override TerranState.TerranUpgrade GetUpgrade(TerranState state) { return state.ShipWeapons3; }
		public override string EventName { get { return "ActionResearchedShipWeapons3"; } }
		public override bool HaveTechnology(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.HaveTechnology(bo) && state.ShipWeapons2.Available;
		}
		public override bool IsInvalid(IBuildOrder bo)
		{
			TerranState state = bo.State as TerranState;
			return base.IsInvalid(bo) || !state.ShipWeapons2.Have;
		}
		public override IAction[,] Requirements
		{
			get
			{
				if (m_Requirements == null)
					m_Requirements = new IAction[,] { { ActionUpgradeShipWeapons2.Instance } };
				return m_Requirements;
			}
		}
	}
}
